This section describes how to boot the kernel. The basic command required to boot Linux/APUS using a ram disk as main file system is:
bootstrap --apus -k vmlinux -r ramdisk.image.gz root=/dev/ram |
The root=/dev/ram option tells the kernel to read its data from the ram disk, -k specifies the kernel image to boot, -r the ram disk file and --apus that the PowerPC should be the CPU starting the kernel.
The above is how you would boot on a simple system. When issuing the command bootstrap you may need additional parameters (at the end) for the kernel to work on your system - this is just the same as if you were booting a Linux/m68k system. Display selection, display resolution, SCSI driver options and other things are controlled by such additional options.
There are two specific Linux/APUS kernel options:
60nsram
Use this to remove RAM waitstates. It requires 60ns RAM.
nobats
Use this to prevent the use of BATs for mapping of main memory. Selecting this incurs a small performance overhead, but some drivers depend on each memory page being individually mapped (A4000T/A4091 SCSI drivers).
Other kernel options exist, but are shared with Linux/m68k and other ports so I don't describe them here. One of the files you should download (kernel-options.txt) describes the options you can use. The Linux/m68k website/FAQ should also contain some general information about the boot options.
A ram disk image is used to get started. The ram disk contains a minimal Linux system from which you prepare your disks. When you have done this (described in sections below), you will normally use root=/dev/xxx (where xxx is the root partion) to boot your Linux/APUS system.
Notice that booting the Linux/APUS kernel might blank the display for as long as 30 seconds depending on the PowerPC speed.
Some people have reported problems with copying the ram disk (and kernel) to RAM: before booting and must use a disk partition for the files. Others need to copy the files to RAM:, especially Blizzard/PPC owners who use SCSI disks.
Additional to options for making your hardware run smoothly with Linux, you may need to restrict your memory configuration for Linux/APUS to work correctly.
Linux/APUS only supports one block of primary memory which should be the memory on the PowerUp board. It would be possible to support mutiple blocks, but since there is such a big performance penalty in using other system memory than the one on the PowerUp board, it doesn't make sense.
The problem is that Linux uses memory much more aggressively than Amiga DOS so all memory will be used constantly. Because of this it is not possible to prioritize memory blocks as it can be done under Amiga DOS. This means that you cannot guarantee that the most CPU intensive applications actually run in the fastest memory block in the system. For this reason, Linux/APUS only support one block of primary memory -- the fastest. See the section called Memory-to-Memory Swapping for a way of using additional memory.
If you have multiple memory blocks, the one on the CyberStorm/PPC/Blizzard/PPC will usually have the highest priority and be selected by default. Unfortunately, this is not foolproof and you may have to explicitly define the block to be used.
You control the memory Linux can see by using a memory config file: add -m file after the --apus option. This file should contain 2 lines: on the first the size of your chip memory, on the second the starting address of the memory and its size. Here's a single example.
2097152 0x08000000 33030144 |
The format of memory files actually allow more memory blocks to be specified (since it was created for Linux/m68k), but only one memory block can be used in Linux/APUS. If you have more than one block of memory in your system, you must specify the block located on the CyberStorm/PPC or Blizzard/PPC card.
You should be able to get the required numbers from showconfig or a similar tool under Amiga DOS.
Notice that the size of the memory is 512kB less than what you would expect (33030144 is 31.5MB). This is normal and required. The 512kB block is used to hold the PowerPC exception vector table and other Phase5 stuff.
If you are using the Shadow hardware on your Phase5 CyberStorm/PPC or Blizzard/PPC board to remap the Amiga DOS ROM to RAM, you should either disable this before booting Linux/APUS or make sure the memory size reflects this mapping: the memory size reported by bootstrap should be 1MB smaller than the amount of RAM in your system. If it is only 512kB smaller, you have to use a memfile, specifying the total amount of RAM less the 1MB.
The newer kernels (980725+) will detect the ROM shadowing (based on the memory size) and will avoid that chunk of memory. This means 512kB of your memory will remain unused in Linux/APUS. If you do not subtract the 512kB when specifying the size in a memfile, the kernel will not boot!
Even though only one block of memory can be used for primary memory in Linux/APUS you can use other memory resources as a fast swapping device. Using slower memory for swapping makes sense; your applications are always running in the fast primary memory on the PowerUp board, but the slower memory is still providing a much faster page swapping service than the harddisk would.
You specify a block of memory for swapping by adding a line to the memory file (or by relying on the default Amiga DOS priority ordering of the memory blocks). On my box, I have 32MB on the CyberStorm/PPC and 8MB on the motherboard of my A4000. The default Amiga DOS ordering matches this memory file:
2097152 0x08000000 33030144 0x07800000 8388608 |
Again, the default Amiga DOS priority ordering may do the correct thing for you. If not, you have to use a memory file.
After booting, you need to tell Linux to use the new swapping device. First you must add a new device node:
mknod /dev/fastram b 37 4 |
Each time you boot you have to initialize the memory area (it doesn't keep its state over reboot as your swap partition does), and enable it with a higher priority than the swap partition (put the lines in /etc/rc.d/sysinit or similar).
mkswap /dev/fastram swapon -p1 /dev/fastram |
In the above only a single memory chunk is used for swapping. The z2ram device can only handle one chunk at the moment. However, it can select other than the second chunk of the memory list; minor numbers 4, 5, 6, and 7 select memory chunks 2, 3, 4, and 5 respectively, chunk 1 being used as primary memory.